public class Test31 {
	public static void main(String[] args) {
		String[] ia = { "J42-4301180", "DPUB-03191-AAX-X27-1104113",
				"DPUB-04008-AAX-X27-1303700", "DPUB-03201-AAX-X27-1208013",
				"DPUB-04116-AAX-X27-1303805", "DPUB-02444-AAX-X27-1001310BA",
				"DPUB-04010-AAX-X27-1303419", "DPUB-04009-AAX-X27-1303417",
				"J42-1303301", "M11-1109210BC", "J42-1303201" };// ","
		int n = 2;// ","
		System.out.println("组合结果 : ");
		System.out.println();
		combination(ia, n);
		System.out.println();
		System.out
				.println("---------------------------------------------------");
	}

	// 规则编号

	static String rulernumber = "67";

	public static void combination(String[] ia, int n) {
		combination("", ia, n);
	}

	public static void combination(String s, String[] ia, int n) {
		if (n == 1) {
			for (int i = 0; i < ia.length; i++) {
				System.out.println(rulernumber
						+ ",\"a\",Left Node,Node Parents,Y,eaiclNAME,%" + s
						+ "%");
				System.out.println(rulernumber
						+ ",\"a\",Right Node,Node Parents,Y,eaiclNAME,%"
						+ ia[i] + "%");
			}
		} else {
			for (int i = 0; i < ia.length - (n - 1); i++) {
				String ss = "";
				ss = s + ia[i];
				// 建立从i开始的子数组
				String[] ii = new String[ia.length - i - 1];
				for (int j = 0; j < ia.length - i - 1; j++) {
					ii[j] = ia[i + j + 1];
				}

				combination(ss, ii, n - 1);
			}
		}
	}
}
